var mainApp = angular.module("mainApp");

mainApp.controller("logController", function($scope, $http) {
	var lm = $scope.lm = {
		log : {},
		pager : {}
	}

	lm.query = function() {
		var data = {
			username : lm.log.username,
			beginTime : lm.log.beginTime,
			endTime : lm.log.endTime,
			pageNum : lm.pager.pageNum,
			pageSize : lm.pager.pageSize
		}
		$http.post("system/log/list.do", data).success(function(data) {
			lm.pager = data.loglist;
		})
	}

	lm.query();

	lm.clear = function() {
		lm.log = {};
		lm.pager = {};
		lm.query();
	}

	$(".dateTimePicker").datetimepicker({
		lang : 'ch',
		format : 'Y-m-d H:i',
		todayButton : true,
		endDate : new Date(),
		closeOnDateSelect : true
	});
})